package com.moleq.models;

import com.moleq.db.DatabaseSchema;


public class AgeSetting {
	// CREATE TABLE t_age_setting
	// (as_no INTEGER NOT NULL,
	// as_desc varchar(30) NULL,
	// as_age numeric(3,0) Default 0 NOT NULL,
	// create_datetime varchar(14) NOT NULL,
	// update_datetime varchar(14) NOT NULL,
	// PRIMARY KEY (as_no));

	private int as_no;
	private String as_desc;
	private int as_age;
	private String create_datetime;
	private String update_datetime;

	public AgeSetting() {
	}

	public AgeSetting(int as_no, String as_desc, int as_age,
			String create_datetime, String update_datetime) {
		this.as_no = as_no;
		this.as_desc = as_desc;
		this.as_age = as_age;
		this.create_datetime = create_datetime;
		this.update_datetime = update_datetime;

	}

	public AgeSetting(int as_no, String as_desc, int as_age) {
		this.as_no = as_no;
		this.as_desc = as_desc;
		this.as_age = as_age;
	}

	public int getAs_no() {
		return as_no;
	}

	public void setAs_no(int as_no) {
		this.as_no = as_no;
	}

	public String getAs_desc() {
		return as_desc;
	}

	public void setAs_desc(String as_desc) {
		this.as_desc = as_desc;
	}

	public int getAs_age() {
		return as_age;
	}

	public void setAs_age(int as_age) {
		this.as_age = as_age;
	}

	public String getCreate_datetime() {
		return create_datetime;
	}

	public void setCreate_datetime(String create_datetime) {
		this.create_datetime = create_datetime;
	}

	public String getUpdate_datetime() {
		return update_datetime;
	}

	public void setUpdate_datetime(String update_datetime) {
		this.update_datetime = update_datetime;
	}

	public String toMGData(String Action) {
		String Result = Action + "|" + DatabaseSchema.AgeSetting.SCHEMA_NAME
				+ "|(" + getAs_no() + "," + CheckNull(getAs_desc()) + "," + getAs_age()
				+ "," + CheckNull(getCreate_datetime()) + "," + CheckNull(getUpdate_datetime())
				+ ")";
		return Result;
	}

	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}
}
